# Copyright (c) 2021-2023 Alibaba Cloud Computing Ltd.
# SPDX-License-Identifier: MulanPSL-2.0
import json
import logging

from tornado.web import RequestHandler
from agent.controller import search_active_domain

logger = logging.getLogger('common')

class StatusHandler(RequestHandler):
    def get(self):
        self.write(json.dumps({"status": "alive"}))
        self.finish()


class AvaliableDomainHandler(RequestHandler):
    def get(self):
        self.write(json.dumps({"result": search_active_domain()}))
        self.finish()